package com.rd.student.jike.class4.xiayinyin.day23;

public class Demo01{
    public static void main(String[] args) {

        Thread1 thread1 = new Thread1();
        Thread2 thread2 = new Thread2();
        thread1.start();
        thread2.start();
    }
}

class Thread1 extends Thread{

    @Override
    public void run(){
        for (int i = 1; i < 53; i++) {
            System.out.println(i);
            if (i%2 == 0){
                try {
                    join(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

class Thread2 extends Thread{

    @Override
    public void run(){
        for (int i = 65; i < 91; i++) {
            char i1 = (char) i;
            System.out.println(i1);
            try {
                join(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
